Test modulesΒΆ
import ipyvolume.datasets
stream = ipyvolume.datasets.animated_stream.fetch()
# print("shape of steam data", stream.data.shape) # first dimension contains x, y, z, vx, vy, vz, then time, then particle
fig = ipv.figure()
# instead of doing x=stream.data[0], y=stream.data[1], ... vz=stream.data[5], use *stream.data
# limit to 50 timesteps to avoid having a huge notebook
q = ipv.quiver(*stream.data[:,0:50,:200], color="red", size=7)
ipv.style.use("dark") # looks better
ipv.animation_control(q, interval=200)
ipv.show()
Downloading https://github.com/maartenbreddels/ipyvolume/raw/master/datasets/stream-animation.npy.bz2 to /home/runner/.ipyvolume/datasets/stream-animation.npy.bz2
--2021-11-16 14:20:34-- https://github.com/maartenbreddels/ipyvolume/raw/master/datasets/stream-animation.npy.bz2
Resolving github.com (github.com)... 140.82.114.4
Connecting to github.com (github.com)|140.82.114.4|:443... connected.
HTTP request sent, awaiting response...
302 Found
Location: https://raw.githubusercontent.com/maartenbreddels/ipyvolume/master/datasets/stream-animation.npy.bz2 [following]
--2021-11-16 14:20:34-- https://raw.githubusercontent.com/maartenbreddels/ipyvolume/master/datasets/stream-animation.npy.bz2
Resolving raw.githubusercontent.com (raw.githubusercontent.com)... 185.199.109.133, 185.199.108.133, 185.199.111.133, ...
Connecting to raw.githubusercontent.com (raw.githubusercontent.com)|185.199.109.133|:443... connected.
HTTP request sent, awaiting response... 200 OK
Length: 7963751 (7.6M) [application/octet-stream]
Saving to: β/home/runner/.ipyvolume/datasets/stream-animation.npy.bz2β
stream-animation.np 0%[ ] 0 --.-KB/s
stream-animation.np 100%[===================>] 7.59M --.-KB/s in 0.03s
2021-11-16 14:20:35 (236 MB/s) - β/home/runner/.ipyvolume/datasets/stream-animation.npy.bz2β saved [7963751/7963751]